﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
              xmlns:local="clr-namespace:WordsAsap.Pages" 
             xmlns:WordsAsap="clr-namespace:WordsAsap" xmlns:Settings="clr-namespace:WordsAsap.Pages.Settings" 
                x:Name="WordPage1" x:Class="WordsAsap.Pages.WordPage" 
             mc:Ignorable="d" 
             d:DesignHeight="150" d:DesignWidth="150"
    >
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="VisibilityConverter" />
    </UserControl.Resources>
    <UserControl.DataContext >
        <local:WordPageViewModel />
    </UserControl.DataContext>

    <Grid Style="{StaticResource ContentRoot}">
        <ScrollViewer>
            <StackPanel MinWidth="200">
                
                <Grid HorizontalAlignment="Stretch">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" HorizontalAlignment="Left"
                               Text="{Binding WordToDisplay}"
                               Margin="3"
                               Foreground="{Binding FontColor}"
                               FontSize="{Binding FontSize}" />
                   
                    <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
                        <StackPanel Orientation="Horizontal"
                                    Margin="5">
                            <TextBlock Text="{Binding NumberOfWrong}"
                                       Foreground="{Binding FontColor}" />
                            <Viewbox Width="12"
                                     Height="12">
                                <Path Data="F1 M 38.3958,62.1458C 38.3958,55.8125 41.1667,49.875 41.1667,51.4583C 41.1667,53.0417 44.3333,46.7083 45.9167,43.5417C 47.5,40.375 49.0833,36.0208 49.0833,36.0208L 55.4167,36.4167C 55.4167,36.4167 57,22.5625 53.8333,20.9792C 50.6667,19.3958 47.3692,21.6132 44.3333,19.7917C 36.4167,15.0417 23.75,18.2083 25.3333,21.375C 25.3333,21.375 19,24.5417 20.5833,26.125C 20.5833,26.125 19,28.5 20.9792,30.875C 19,33.25 19.7917,35.625 20.9792,37.2083C 19.7917,39.5833 19,41.9583 23.75,43.5417C 26.7542,44.5431 34.8333,40.7708 34.8333,45.125C 34.8333,46.7083 31.6667,51.4583 31.6667,54.625C 31.6667,60.9583 38.3958,62.1458 38.3958,62.1458 Z "
                                      Fill="{Binding FillBursh}" />
                            </Viewbox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal"
                                    Margin="5">
                            <TextBlock Text="{Binding NumberOfCorrect}"
                                       Foreground="{Binding FontColor}" />
                            <Viewbox Width="12"
                                     Height="12">
                                <Path Data="F1 M 36.8125,14.4232C 36.8125,20.7565 34.0416,26.694 34.0416,25.1107C 34.0416,23.5274 30.875,29.8607 29.2916,33.0274C 27.7083,36.194 26.125,40.5482 26.125,40.5482L 19.7917,40.1524C 19.7917,40.1524 18.2083,54.0065 21.375,55.5899C 24.5417,57.1732 27.8391,54.9558 30.875,56.7774C 38.7916,61.5274 51.4583,58.3607 49.875,55.194C 49.875,55.194 56.2083,52.0274 54.625,50.444C 54.625,50.444 56.2083,48.069 54.2292,45.694C 56.2083,43.319 55.4167,40.944 54.2292,39.3607C 55.4167,36.9857 56.2083,34.6107 51.4583,33.0274C 48.4542,32.026 40.375,35.7982 40.375,31.444C 40.375,29.8607 43.5416,25.1107 43.5416,21.944C 43.5416,15.6107 36.8125,14.4232 36.8125,14.4232 Z "
                                      Fill="{Binding FillBursh}" />
                            </Viewbox>
                        </StackPanel>
                    </StackPanel>
                </Grid>

                <ListView ItemsSource="{Binding Translations}" Visibility="{Binding ShowTranslation, Converter={StaticResource VisibilityConverter}}" Margin="3" x:Name="lstvInternal" >
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <Grid Margin="0,0,0,5">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="{Binding}" FontSize="{Binding FontSize}"/>
                            </Grid>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
                
                <mui:ModernButton Padding="10" Margin="20"
                                  Command="{Binding ShowTranslationCommand}">
                    <mui:ModernButton.Style>
                        <Style TargetType="{x:Type mui:ModernButton}">
                            <Setter Property="IconData" Value="F1 M 37.8516,39.5833L 52.1016,24.9375L 52.1016,35.2292L 37.8516,50.2708L 23.6016,35.2292L 23.6016,24.9375L 37.8516,39.5833 Z" />
                            <Setter Property="Content" Value="show translation"/>
                            <Style.Triggers>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Visibility, ElementName=lstvInternal}" Value="Visible" />
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="IconData" Value="F1 M 37.8516,35.625L 34.6849,38.7917L 23.6016,50.2708L 23.6016,39.9792L 37.8516,24.9375L 52.1016,39.9792L 52.1016,50.2708L 41.0182,38.7917L 37.8516,35.625 Z" />
                                    <Setter Property="Content" Value="hide translation"/>
                                </MultiDataTrigger>
                            </Style.Triggers>
                        </Style>
                    </mui:ModernButton.Style>
                </mui:ModernButton>
                <StackPanel Margin="2" Orientation="Horizontal">
                   
                    <mui:ModernButton Padding="1,10,10,10"
                                      Margin="1,20,20,20"
                                      Content="wrong"  
                                      CommandParameter="{Binding ElementName=WordPage1}"
						Command="{Binding WrongAnswer}"
						IconData="F1 M 38.3958,62.1458C 38.3958,55.8125 41.1667,49.875 41.1667,51.4583C 41.1667,53.0417 44.3333,46.7083 45.9167,43.5417C 47.5,40.375 49.0833,36.0208 49.0833,36.0208L 55.4167,36.4167C 55.4167,36.4167 57,22.5625 53.8333,20.9792C 50.6667,19.3958 47.3692,21.6132 44.3333,19.7917C 36.4167,15.0417 23.75,18.2083 25.3333,21.375C 25.3333,21.375 19,24.5417 20.5833,26.125C 20.5833,26.125 19,28.5 20.9792,30.875C 19,33.25 19.7917,35.625 20.9792,37.2083C 19.7917,39.5833 19,41.9583 23.75,43.5417C 26.7542,44.5431 34.8333,40.7708 34.8333,45.125C 34.8333,46.7083 31.6667,51.4583 31.6667,54.625C 31.6667,60.9583 38.3958,62.1458 38.3958,62.1458 Z " 
                                       />

                    <mui:ModernButton Padding="10,10,1,10"
                                      Margin="20,20,1,20"
                                      Content="correct"  CommandParameter="{Binding ElementName=WordPage1}"
						Command="{Binding RightAnswer}"
						IconData="F1 M 36.8125,14.4232C 36.8125,20.7565 34.0416,26.694 34.0416,25.1107C 34.0416,23.5274 30.875,29.8607 29.2916,33.0274C 27.7083,36.194 26.125,40.5482 26.125,40.5482L 19.7917,40.1524C 19.7917,40.1524 18.2083,54.0065 21.375,55.5899C 24.5417,57.1732 27.8391,54.9558 30.875,56.7774C 38.7916,61.5274 51.4583,58.3607 49.875,55.194C 49.875,55.194 56.2083,52.0274 54.625,50.444C 54.625,50.444 56.2083,48.069 54.2292,45.694C 56.2083,43.319 55.4167,40.944 54.2292,39.3607C 55.4167,36.9857 56.2083,34.6107 51.4583,33.0274C 48.4542,32.026 40.375,35.7982 40.375,31.444C 40.375,29.8607 43.5416,25.1107 43.5416,21.944C 43.5416,15.6107 36.8125,14.4232 36.8125,14.4232 Z " 
                                       />
                   
                </StackPanel>
            </StackPanel>

        </ScrollViewer>
    </Grid>

</UserControl>
